package com.itheima.controller;

import com.itheima.pojo.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <dl>
 * <dd>描述: ~节点业务逻辑实现</dd>
 * <dd>创建时间：  14:43 2020/4/21</dd>
 * <dd>创建人： zz</dd>
 * <dt>版本历史: </dt>
 * <pre>
 * Date         Author      Version     Description
 * ------------------------------------------------------------------
 * 2020/4/21      guodong       1.0        1.0 Version
 * </pre>
 * </dl>
 */
@RestController
public class HelloController {

    @Value("${personName}")
    private String perName;
    @Autowired
    private Person person;
    /*
        @RequestMapping("/sayHello") 支持所有请求
        @RequestMapping(value = "/sayHello",method = RequestMethod.GET) 支持get请求
        @GetMapping("/sayHello") 表示是一个get请求资源
        @PostMapping("/sayHello")  表示是一个post请求资源

     */
    //@RequestMapping("/sayHello")
    //@RequestMapping(value = "/sayHello",method = RequestMethod.GET)
    @GetMapping("/sayHello")
    public String sayHello(){
        return "364 is good class";
    }

    @GetMapping("/getPerName")
    public String getPerName(){
        return perName;
    }
    @GetMapping("/getPerson")
    public Person getPerson(){
        return person;
    }

}
